<style>
    table tr{
        line-height: 30px;
    }
</style>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header" style="margin-top:1px;">
                    区域/应用添加
                </div>
                <ul class="nav nav-tabs">
                    <li class="active" ng-click="tabClick('zone')">
                        <a style="cursor: pointer;" data-toggle="tab">
                            区域
                        </a>
                    </li>
                    <li class="" ng-click="tabClick('app')">
                        <a style="cursor: pointer;" data-toggle="tab">
                            应用
                        </a>
                    </li>
                </ul>
                <div class="box-body">
                    <div ng-if="info.addType == 'zone'">
                        <table width="95%">
                            <tr>
                                <td style="width: 10%"><span style="color: red;">*</span>区域code:</td>
                                <td style="width: 20%">
                                    <input type="text" ng-model="info.zone.zone_code"/>
                                </td>
                                <td>
                                    <span>区域代号全拼，如:uc.gzidc.area</span>
                                </td>
                            </tr>
                            <tr>
                                <td><span style="color: red;">*</span>区域代号:</td>
                                <td>
                                    <input type="text" ng-model="info.zone.zone_alias"/>
                                </td>
                                <td>
                                    <span>区域代号缩写，如:gzidc</span>
                                </td>
                            </tr>
                            <tr>
                                <td><span style="color: red;">*</span>区域名:</td>
                                <td>
                                    <input type="text" ng-model="info.zone.zone_title"/>
                                </td>
                                <td>
                                    <span>区域名称，如:中国区</span>
                                </td>
                            </tr>
                            <tr>
                                <td>父级区域:</td>
                                <td>
                                    <div class="row">
                                        <div class="col-xs-8">
                                            <select class="form-control" ng-model="info.zone.parent_code"
                                                    ng-options="i.zone_code as i.zone_title for i in info.selectZoneList">
                                                <option value="">请选择</option>
                                            </select>
                                        </div>
                                    </div>
                                </td>
                                <td>
                                    <span>区域所属数据中心</span>
                                </td>
                            </tr>
                            <tr>
                                <td><span style="color: red;">*</span>序号:</td>
                                <td>
                                    <input type="text" ng-model="info.zone.order_no"/>
                                </td>
                                <td>
                                    <span>区域显示的序号，为数字</span>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div ng-if="info.addType == 'app'">
                        <table width="95%">
                            <tr>
                                <td style="width: 10%"><span style="color: red;">*</span>应用id:</td>
                                <td style="width: 20%">
                                    <input type="text" ng-model="info.app.app_id"/>
                                </td>
                                <td>
                                    <span>应用id,一般为区域+应用，如：gzidc:sms</span>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 10%"><span style="color: red;">*</span>应用名:</td>
                                <td style="width: 20%">
                                    <input type="text" ng-model="info.app.app_name"/>
                                </td>
                                <td>
                                    <span>应用名称</span>
                                </td>
                            </tr>
                            <tr>
                                <td>应用类型:</td>
                                <td>
                                    <div class="row">
                                        <div class="col-xs-8">
                                            <select class="form-control" ng-model="info.app.app_type">
                                                <option value="tomcat">tomcat</option>
                                                <option value="php">php</option>
                                                <option value="adempiere">adempiere</option>
                                                <option value="spring-boot">spring-boot</option>
                                            </select>
                                        </div>
                                    </div>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td><span style="color: red;">*</span>端口:</td>
                                <td style="width: 20%">
                                    <input type="text" ng-model="info.app.port"/>
                                </td>
                                <td>
                                    <span>应用端口</span>
                                </td>
                            </tr>
                            <tr>
                                <td>所属区域:</td>
                                <td>
                                    <div class="row">
                                        <div class="col-xs-8">
                                            <select class="form-control" ng-model="info.app.zone_code"
                                                    ng-options="i.zone_code as i.zone_title for i in info.selectZoneList">
                                            </select>
                                        </div>
                                    </div>
                                </td>
                                <td>
                                    <span>区域所属数据中心</span>
                                </td>
                            </tr>
                            <tr>
                                <td><span style="color: red;">*</span>启动顺序:</td>
                                <td style="width: 20%">
                                    <input type="text" ng-model="info.app.starting_order"/>
                                </td>
                                <td>
                                    <span>应用在区域内的启动顺序,0-100为组件应用，101-200是区域基础应用，201以上为业务应用</span>
                                </td>
                            </tr>
                            <tr>
                                <td>数据库类型:</td>
                                <td>
                                    <div class="row">
                                        <div class="col-xs-8">
                                            <select class="form-control" ng-model="info.app.db_type">
                                                <option value="">请选择</option>
                                                <option value="mysql">mysql</option>
                                                <option value="cassandra">cassandra</option>
                                                <option value="oracle">oracle</option>
                                            </select>
                                        </div>
                                    </div>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>数据库名:</td>
                                <td style="width: 20%">
                                    <input type="text" ng-model="info.app.db_name"/>
                                </td>
                                <td>
                                    <span>应用对应数据库名称</span>
                                </td>
                            </tr>
                            <tr>
                                <td>是否用beetle管理:</td>
                                <td>
                                    <div class="row">
                                        <div class="col-xs-8">
                                            <select class="form-control" ng-model="info.app.on_beetle">
                                                <option value="true">是</option>
                                                <option value="false">否</option>
                                            </select>
                                        </div>
                                    </div>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <input type="button" class="btn btn-info" ng-click="save()" ng-disabled="!info.validate"
                           value="保存"/>
                    <input type="button" class="btn btn-info" ng-click="goback()" style="margin-left: 5%" value="返回"/>
                </div>
            </div>
        </div>
    </div>
</section>
